<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>find manual page - [incr Tcl]</TITLE>
<link rel="stylesheet" href="../docs.css" type="text/css" media="all">
</HEAD>
<BODY><H2><a href="../contents.htm">Tcl8.6.11/Tk8.6.11 Documentation</a> <small>&gt;</small> <a href="contents.htm">[incr Tcl] Package Commands, version 4.2.1</a> <small>&gt;</small> find</H2>
<H3><A HREF="../UserCmd/contents.htm">Tcl/Tk Applications</A> | <A HREF="../TclCmd/contents.htm">Tcl Commands</A> | <A HREF="../TkCmd/contents.htm">Tk Commands</A> | <A HREF="../ItclCmd/contents.htm">[incr Tcl] Package Commands</A> | <A HREF="../SqliteCmd/contents.htm">SQLite3 Package Commands</A> | <A HREF="../TdbcCmd/contents.htm">TDBC Package Commands</A> | <A HREF="../TdbcmysqlCmd/contents.htm">tdbc::mysql Package Commands</A> | <A HREF="../TdbcodbcCmd/contents.htm">tdbc::odbc Package Commands</A> | <A HREF="../TdbcpostgresCmd/contents.htm">tdbc::postgres Package Commands</A> | <A HREF="../TdbcsqliteCmd/contents.htm">tdbc::sqlite3 Package Commands</A> | <A HREF="../ThreadCmd/contents.htm">Thread Package Commands</A> | <A HREF="../TclLib/contents.htm">Tcl C API</A> | <A HREF="../TkLib/contents.htm">Tk C API</A> | <A HREF="../ItclLib/contents.htm">[incr Tcl] Package C API</A> | <A HREF="../TdbcLib/contents.htm">TDBC Package C API</A></H3>
<H3><A NAME="M2">NAME</A></H3>
itcl::find &mdash; search for classes and objects
<H3><A NAME="M3">SYNOPSIS</A></H3>
<B><A HREF="../ItclCmd/find.htm">itcl::find </A></B><I>option</I> ?<I>arg arg ...</I>?<BR>
<H3><A NAME="M4">DESCRIPTION</A></H3>
The <B>find</B> command is used to find classes and objects
that are available in the current interpreter.  Classes and objects
are reported first in the active namespace, then in all other
namespaces in the interpreter.
<P>
The <I>option</I> argument determines what action is carried out
by the command.  The legal <I>options</I> (which may be abbreviated)
are:
<P>
<DL class="description">
<DT><A NAME="M5"><B>find classes ?</B><I>pattern</I>?</A><DD>
Returns a list of [incr Tcl] classes.  Classes in the current
namespace are listed first, followed by classes in all other
namespaces in the interpreter.  If the optional <I>pattern</I>
is specified, then the reported names are compared using the rules
of the &quot;<B><A HREF="../TclCmd/string.htm">string match</A></B>&quot; command, and only matching names are
reported.
<P>
If a class resides in the current namespace context, this command
reports its simple name--without any qualifiers.  However, if the
<I>pattern</I> contains <B>::</B> qualifiers, or if the class resides
in another context, this command reports its fully-qualified name.
Therefore, you can use the following command to obtain a list where
all names are fully-qualified:
<P>
<PRE>itcl::find classes ::*</PRE>
<P><DT><A NAME="M6"><B>find objects ?</B><I>pattern</I>? ?<B>-class </B><I>className</I>? ?<B>-isa </B><I>className</I>?</A><DD>
Returns a list of [incr Tcl] objects.  Objects in the current
namespace are listed first, followed by objects in all other
namespaces in the interpreter.  If the optional <I>pattern</I> is
specified, then the reported names are compared using the rules
of the &quot;<B><A HREF="../TclCmd/string.htm">string match</A></B>&quot; command, and only matching names are
reported.
If the optional &quot;<B>-class</B>&quot; parameter is specified, this list is
restricted to objects whose most-specific class is <I>className</I>.
If the optional &quot;<B>-isa</B>&quot; parameter is specified, this list is
further restricted to objects having the given <I>className</I>
anywhere in their heritage.
<P>
If an object resides in the current namespace context, this command
reports its simple name--without any qualifiers.  However, if the
<I>pattern</I> contains <B>::</B> qualifiers, or if the object resides
in another context, this command reports its fully-qualified name.
Therefore, you can use the following command to obtain a list where
all names are fully-qualified:
<P>
<PRE>itcl::find objects ::*</PRE>
<P></DL>
<H3><A NAME="M7">KEYWORDS</A></H3>
<A href="../Keywords/C.htm#class">class</A>, <A href="../Keywords/O.htm#object">object</A>, <A href="../Keywords/S.htm#search">search</A>, <A href="../Keywords/I.htm#import">import</A>
<div class="copy">Copyright &copy; 1993-1998 Lucent Technologies, Inc.
</div>
</BODY></HTML>
